// 车类 快车 专车  价格不同  行程开始 行程结束

class Car {
    constructor(number,name){
        this.number = number
        this.name = name
    }
}

class Kuai extends Car {
    constructor(number,name){
        super(number,name)
        this.price = 1
    }
}
class Zhuan extends Car {
    constructor(number,name){
        super(number,name)
        this.price = 2
    }
}

class Trip {
    constructor(car,km){
        this.car = car
        this.km=km
    }
    start(){
        document.write('start with car '+this.car.number)
    }
    end(){
        document.write('<br/>price is ' + this.km * this.car.price)
    }
}

let car = new Zhuan(110,'BMW')

let trip = new Trip(car,5)

// trip.start()
// trip.end()